  // 高德地图
  export function loadAMap() {
      return new Promise(function (resolve, reject) {
        console.log("初始化高德地图脚本...");
        const AK = "8b646fe60cf9d4bc19ce58440ec9948d";
        const AMap_URL =
          "https://webapi.amap.com/maps?v=1.4.15&key=" +
          AK +
          "&s=1&callback=onAMapCallback";
        // 如果已加载直接返回
        if (typeof AMap !== "undefined") {
          resolve(AMap);
          return AMap;
        }
        // 高德地图异步加载回调处理
        window.onAMapCallback = function () {
          console.log("高德地图脚本初始化成功...");
          resolve(AMap);
        };
    
        // 插入script脚本
        let scriptNode = document.createElement("script");
        scriptNode.setAttribute("type", "text/javascript");
        scriptNode.setAttribute("src", AMap_URL);
        document.head.appendChild(scriptNode);
      });
  }
  
  // 百度地图
  export function loadBMap() {
    return new Promise(function (resolve, reject) {
      console.log("初始化百度地图脚本...");
      const AK = "xgepqYY4DUy0gPkU1LPyMp42yqVRbQ2b";
      const BMap_URL =
        "https://api.map.baidu.com/api?v=2.0&ak=" +
        AK +
        "&callback=onBMapCallback";
      // 如果已加载直接返回
      if (typeof BMap !== "undefined") {
        resolve(BMap);
        return true;
      }
      // 百度地图异步加载回调处理
      window.onBMapCallback = function () {
        console.log("百度地图脚本初始化成功...");
        resolve(BMap);
      };
  
      // 插入script脚本
      let scriptNode = document.createElement("script");
      scriptNode.setAttribute("type", "text/javascript");
      scriptNode.setAttribute("src", BMap_URL);
      document.body.appendChild(scriptNode);
    });
  }
  
  // 腾讯地图
  export function loadTMap() {
    return new Promise(function (resolve, reject) {
      console.log("初始化腾讯地图脚本...");
      const AK = "ETCBZ-CCH6J-XEEFA-FBSYP-RAYGS-GRB5X";
      const TMap_URL =
        "https://map.qq.com/api/gljs?v=1.exp&key=" +
        AK +
        "&callback=onTMapCallback";
      // 如果已加载直接返回
      if (typeof TMap !== "undefined") {
        resolve(TMap);
        return true;
      }
      // 腾讯地图异步加载回调处理
      window.onTMapCallback = function () {
        console.log("腾讯地图脚本初始化成功...");
        resolve(TMap);
      };
  
      // 插入script脚本
      let scriptNode = document.createElement("script");
      scriptNode.setAttribute("type", "text/javascript");
      scriptNode.setAttribute("src", TMap_URL);
      document.body.appendChild(scriptNode);
    });
  }